﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.SqlClient;
using System.Data;
namespace hoangnam12
{
    public class dataprovider
    {
        public SqlConnection GetConnection()
        {
           SqlConnection conn = new SqlConnection();
           conn.ConnectionString = "Data Source=ADMIN;Initial Catalog=QLBH;Integrated Security=True";
           return conn;
        }
        public void Executenonquery(string sql)
        {
            SqlConnection con = GetConnection();
            SqlCommand cmd = new SqlCommand(sql, con);
            con.Open();
            cmd.ExecuteNonQuery();
            con.Close();
            cmd.Dispose();
        }

        public SqlDataReader ExecuteReader(string sql)
        {
            SqlConnection conn = GetConnection();
            conn.Open();
            SqlCommand cmd = new SqlCommand(sql, conn);
            SqlDataReader reader = cmd.ExecuteReader();
            return reader;
            tôi là nam 
<<<<<<< .mine
          toi bi khung
=======
          tôi bị khùng.
>>>>>>> .r4
        }
    }
}